from django.db import models


# Create your models here.
# 多对多关系设计   book  author  book_author
class Author(models.Model):
    name = models.CharField(max_length=100)
    age = models.IntegerField()

    class Meta:
        db_table = 'author'


class Book(models.Model):
    name = models.CharField(max_length=100)
    price = models.IntegerField()
    authors = models.ManyToManyField(Author)

    class Meta:
        db_table = 'bok'
